<ul title="<%= @panel_title || "Spendy! Expense Listing" %>" selected="true">

  <% flash.each do |key,value| %>
  <li class="flash"><span class="flash_<%=h key %>"><%= value %></span></li>
  <% end -%>

  <% @categories.each do |category| -%>
    <li class="group"><%= category.name %> <span>$<%= get_category_total(category) %></span></li>
    <% category.expenses.each do |expense| -%>
	  <%
	    link_text  = "<small>[$" + expense.amount.to_s + "]</small> " + expense.description
        link_text += (!expense.location.blank?) ? " / " + expense.location : ""
	  %>
	  <li><%= link_to link_text, :action => "show", :id => expense %></li>
	<% end -%>
  <% end -%>

</ul>
